package com.godfrey.consumer;

import com.godfrey.api.service.UserService;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * 用户初始化
 *
 * @author godfrey
 * @since 2021-08-22
 */
@Component
public class UserInit implements CommandLineRunner {

    @DubboReference(version = "1.0", parameters = {"unicast", "false"})
    private UserService userService;

    @Override
    public void run(String... args) {
        System.out.println(userService.selectUserById(2));
    }
}